﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace CloudMusic.Converters
{
    public class ArtistTypeToBackgroundColorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string colorKey = string.Empty;
            switch (value)
            {
                //星星
                case 200:
                    colorKey = "#FFBD20";
                    break;
                //网易音乐人
                case 2:
                //网易云音乐官方账号
                case 4:
                    colorKey = "#CD2929";
                    break;
                default:
                    colorKey = "#fff";
                    break;
            }
            return colorKey;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value != null && value.Equals(true) ? parameter : Binding.DoNothing;
        }
    }
}
